package com.pei.Servlet;



import com.pei.Service.Impl.userServiceImpl;
import com.pei.Service.userService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * Created by dell on 2018/8/7.
 */
@WebServlet(name = "deluserServlet")
public class deluserServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        userService service=new userServiceImpl();
        service.deluser(Integer.parseInt(request.getParameter("id")));
        if (Integer.parseInt(request.getParameter("idd"))==1) {
            response.sendRedirect("finduserServlet?id=3&idd=1");
        }
        if (Integer.parseInt(request.getParameter("idd"))==2) {
            response.sendRedirect("finduserServlet?id=3&idd=2");
        }
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doPost(request,response);
    }
}
